//
//  WXSExplainViewController.m
//  SleepBooks
//
//  Created by rimi on 16/9/24.
//  Copyright © 2016年 rimi. All rights reserved.
//

#import "WXSExplainViewController.h"

@interface WXSExplainViewController ()

@property (strong, nonatomic) UITextView *aboutView;

@end

@implementation WXSExplainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupSubviews];
}

- (void)setupSubviews{
    UIImageView *bgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"bg"]];
    [bgView setFrame:CGRectMake(0, 0, kBaseWidth, kBaesHeight)];
    [self.view addSubview:bgView];
    [bgView addSubview:self.aboutView];
    self.title = @"说明";
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]}] ;
    [self setupBackBarButton];
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.tabBarController.tabBar.hidden = YES;
}

- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    self.tabBarController.tabBar.hidden = NO;
}

#pragma mark - lazy load

- (UITextView *)aboutView{
    if (!_aboutView) {
        _aboutView = [[UITextView alloc]initWithFrame:CGRectMake(10, 0, kBaseWidth - 20, kBaesHeight - 44)];
        _aboutView.backgroundColor = [UIColor clearColor];
        _aboutView.text = @"睡眠记账使用说明书\n\n\n1.【闹钟】可开启和关闭闹钟功能\n\n2.【开始睡觉】前请先设置好闹钟\n\n3.【结束睡觉】后会生成睡眠报告\n\n4.听一曲中的催眠曲助你安然入睡\n\n5.记一笔记录并改善你的睡眠质量\n";
        _aboutView.textColor = [UIColor whiteColor];
        _aboutView.userInteractionEnabled = NO;
        _aboutView.font = [UIFont systemFontOfSize:16];
        _aboutView.textAlignment = NSTextAlignmentCenter;
    }
    return _aboutView;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
